package com.wanban.tools
import io.reactivex.Observable
import retrofit2.http.*


interface Api {

    // checkApp
    @POST("/ctaid/user/login.do")
    suspend fun checkApp(@Body request: CheckAppRequest): CommonResponse?
    // 获取version
    @POST("/ctaid/user/doApiVersion.do")
    suspend fun getVersion(@Body request: CommonRequest): CommonResponse?
    // 获取广告
    @POST("/ctaid/user/getNewAd/{version}.do")
    suspend fun getAds(@Path("version") version: String, @Body request: CommonRequest): CommonResponse?
    // limit
    @POST("/ctaid/user/limit.do")
    suspend fun getLimit(@Body request: CommonRequest): CommonResponse?
    // 导航
    @POST("/ctaid/user/genres.do")
    suspend fun getHome(@Body request: CommonRequest): CommonResponse?
    // 首页
    @POST("/ctaid/user/index/{page}.do")
    suspend fun getRecommend(@Path("page") page: Int, @Body request: CommonRequest, @Query("id") id: Long): CommonResponse?
    // 查看全部
    @POST("/ctaid/user/viewAll/{id}.do")
    suspend fun getAlbumList(@Path("id") id: Long, @Body request: CommonRequest): CommonResponse?
    // 分类 标签
    @POST("/ctaid/user/category/{genreId}.do")
    suspend fun getSearchTag(@Path("genreId") id: Int, @Body request: CommonRequest): CommonResponse?
    // 分类 内容
    @POST("/ctaid/user/albums_page/{genreId}.do")
    suspend fun getCategoryList(@Path("genreId") id: Int, @Body request: CommonRequest): CommonResponse?
    // 热搜
    @POST("/ctaid/user/hots/{id}.do")
    suspend fun getHotSearch(@Path("id") id: String, @Body request: CommonRequest): CommonResponse?
    // 搜索
    @POST("/ctaid/user/search_page.do")
    suspend fun getSearch(@Body request: CommonRequest): CommonResponse?
    // 视频相关推荐
    @POST("/ctaid/user/related/{id}.do")
    suspend fun getVideoRecommend(@Path("id") id: Int, @Body request: CommonRequest): CommonResponse?
    // 获取全部视频详情
    @POST("/ctaid/user/detail/{id}.do")
    suspend fun getVideoDetail(@Path("id") id: Long, @Body request: CommonRequest): CommonResponse?
    // 根据版本号获取部分详情内容
    @POST("/ctaid/user/doUpdateVodVersion.do")
    suspend fun doUpdateVodVersion(@Body request: CommonRequest): CommonResponse?
    // 升级
    @POST("/ctaid/user/upgrade/{id}.do")
    suspend fun upgrade(@Path("id") id: String, @Body request: CommonRequest): CommonResponse?
    // 升级
    @POST("/ctaid/user/doUnlockNav.do")
    suspend fun getUnlock(@Body request: CommonRequest): CommonResponse?
    // checkApp
    @POST("/ctaid/user/login.do")
    fun checkAppObservable(@Body request: CheckAppRequest): Observable<CommonResponse>
    // 升级
    @POST("/ctaid/user/upgrade/{id}.do")
    fun upgradeObservable(@Path("id") id: String, @Body request: CommonRequest): Observable<CommonResponse>
    // 导航
    @POST("/genuine/user/genres.do")
    suspend fun getGenuineGenres(@Body request: CommonRequest): CommonResponse?
    // 导航
    @POST("/genuine/user/index/{page}.do")
    suspend fun getGenuineRecommend(@Path("page") page: Int, @Body request: CommonRequest, @Query("id") id: Long): CommonResponse?
    // 搜索
    @POST("/genuine/user/search_page.do")
    suspend fun getGenuineSearch(@Body request: CommonRequest): CommonResponse?
    // 获取全部视频详情
    @POST("/genuine/user/detail/{id}.do")
    suspend fun getGenuineVideoDetail(@Path("id") id: Long, @Body request: CommonRequest): CommonResponse?
    @POST("/genuine/user/detail/v2/{id}.do")
    fun getGenuineVideoDetailObservable(@Path("id") id: Long, @Body request: CommonRequest): Observable<CommonResponse>
    @POST("/genuine/user/doUnlockNav.do")
    suspend fun getGenuineUnlock(@Body request: CommonRequest): CommonResponse?
    // 分类 内容
    @POST("/genuine/user/albums_page/{genreId}.do")
    suspend fun getGenuineCategoryList(@Path("genreId") id: Int, @Body request: CommonRequest): CommonResponse?



}